package zkk.com.mengqu.activity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Toast;

import zkk.com.mengqu.R;
import zkk.com.mengqu.adapter.CircleFriendArticleAdapter;
import zkk.com.mengqu.util.NoScrollListView;

/**
 * Created by Administrator on 2017/4/5.
 * 饭友圈饭友具体某个帖子
 */
public class CircleFriendArticleActivity extends Activity implements View.OnClickListener{
    private Context context;
    private ImageView ivBack , share , collect;//返回，分享，收藏
    private LinearLayout agree , newArticle;//点赞
    private NoScrollListView listView;
    private CircleFriendArticleAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_circle_friend_article);
        context = getApplicationContext();
        initView();
    }

    public void initView(){
        ivBack = (ImageView) findViewById(R.id.iv_back);
        share = (ImageView)findViewById(R.id.iv_share);
        collect = (ImageView)findViewById(R.id.iv_collect);
        agree = (LinearLayout)findViewById(R.id.ll_agree);
        newArticle = (LinearLayout)findViewById(R.id.ll_new_article);
        listView = (NoScrollListView)findViewById(R.id.lv_article_list);
        adapter = new CircleFriendArticleAdapter(context);
        listView.setAdapter(adapter);

        ivBack.setOnClickListener(this);
        share.setOnClickListener(this);
        collect.setOnClickListener(this);
        agree.setOnClickListener(this);
        newArticle.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.iv_back:
                finish();
                break;
            case R.id.iv_share:
                Toast.makeText(context , "分享", Toast.LENGTH_LONG).show();
                break;
            case R.id.iv_collect:
                Toast.makeText(context , "收藏", Toast.LENGTH_LONG).show();
                break;
            case R.id.ll_agree:
                Toast.makeText(context , "点赞成功", Toast.LENGTH_LONG).show();
                break;
            case R.id.ll_new_article:
                Toast.makeText(context , "添加新帖", Toast.LENGTH_LONG).show();
                break;
        }
    }
}
